package com.lzx.dormsys.service.impl;

import java.util.List;

import com.lzx.dormsys.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lzx.dormsys.mapper.PersonBeanMapper;
import com.lzx.dormsys.bean.PersonBean;
import com.lzx.dormsys.service.IPersonBeanService;

/**
 * personService业务层处理
 * 
 * @author lzx
 * @date 2021-09-09
 */
@Service
public class PersonBeanServiceImpl implements IPersonBeanService 
{
    @Autowired
    private PersonBeanMapper personBeanMapper;

    /**
     * 查询person
     * 
     * @param personId personID
     * @return person
     */
    @Override
    public PersonBean selectPersonBeanById(Long personId)
    {
        return personBeanMapper.selectPersonBeanById(personId);
    }

    /**
     * 查询person列表
     * 
     * @param personBean person
     * @return person
     */
    @Override
    public List<PersonBean> selectPersonBeanList(PersonBean personBean)
    {
        return personBeanMapper.selectPersonBeanList(personBean);
    }

    /**
     * 新增person
     * 
     * @param personBean person
     * @return 结果
     */
    @Override
    public int insertPersonBean(PersonBean personBean)
    {
        personBean.setCreateTime(DateUtils.getNowDate());
        return personBeanMapper.insertPersonBean(personBean);
    }

    /**
     * 修改person
     * 
     * @param personBean person
     * @return 结果
     */
    @Override
    public int updatePersonBean(PersonBean personBean)
    {
        return personBeanMapper.updatePersonBean(personBean);
    }

    /**
     * 批量删除person
     * 
     * @param personIds 需要删除的personID
     * @return 结果
     */
    @Override
    public int deletePersonBeanByIds(Long[] personIds)
    {
        return personBeanMapper.deletePersonBeanByIds(personIds);
    }

    /**
     * 删除person信息
     * 
     * @param personId personID
     * @return 结果
     */
    @Override
    public int deletePersonBeanById(Long personId)
    {
        return personBeanMapper.deletePersonBeanById(personId);
    }
}
